package net.cyl.strategy;

import java.util.Arrays;
import java.util.List;
import java.util.Random;

public class ShardingDBConfig {

    private static final List<String> dbPrefixList = Arrays.asList("0", "1", "a");

    private static Random random = new Random();

    public static String getRandomDBPrefix(String code) {
        int hashCode = Math.abs(code.hashCode());
        int index=hashCode % dbPrefixList.size();
        return dbPrefixList.get(index);
    }
}
